home *** CD-ROM | disk | FTP | other *** search
/ Champak 142 / Volume 142 Oct 17 2011 - Damaged.iso / Games / parasite-x.swf / scripts / frame_43 / DoAction.as < prev   
Text File  |  2011-10-17  |  2KB  |  106 lines

  1. stop();
  2. _root.liveup = 0;
  3. _root.kills = 0;
  4. _root.score = 0;
  5. _root.handeling = 1;
  6. _root.helpspeed = 0.15;
  7. _root.sizeup = 0;
  8. _root.sizeup2 = 0;
  9. _root.firerate = 1;
  10. _root.enemies = 0;
  11. _root.bombsize = 93;
  12. _root.level1 = 1;
  13. _root.houres = 1;
  14. _root.time1 = 0;
  15. _root.lives = 30 + _root.liveup;
  16. _root.leveltime = 89 * _root.level1;
  17. _root.combo = 1;
  18. _root.spawn = 6;
  19. _root.days = _root.houres * 0.0422;
  20. _root.fire = 0;
  21. _root.Test._y = 927.5;
  22. _root.Test._x = 250.3;
  23. _root.Test._yscale = 4.6 + _root.sizeup;
  24. _root.Test._xscale = 4.6 + _root.sizeup;
  25. _root.Test2._yscale = 34 + _root.sizeup2;
  26. _root.Test2._xscale = 47 + _root.sizeup2;
  27. onMouseDown = function()
  28. {
  29.    if(_root.gamepaused == 0)
  30.    {
  31.       if(_root.delay >= 30 - _root.firerate)
  32.       {
  33.          bomb = attachMovie("bomb","bomb",_root.getNextHighestDepth());
  34.          bomb._y = Test._y;
  35.          bomb._x = Test._x;
  36.          bomb._yscale = _root.bombsize;
  37.          bomb._xscale = _root.bombsize;
  38.          delay = 0;
  39.       }
  40.       setTimeout(function()
  41.       {
  42.          _root.fire = 0;
  43.       }
  44.       ,8400 - _root.firerate + _root.sizeup);
  45.    }
  46. };
  47. onEnterFrame = function()
  48. {
  49.    delay += 0.1;
  50.    if(_root.gamepaused == 0)
  51.    {
  52.       bomb.play();
  53.    }
  54.    else
  55.    {
  56.       bomb.stop();
  57.    }
  58.    draw.clear();
  59.    i = 0;
  60.    while(i < length)
  61.    {
  62.       me = this["line" + i];
  63.       if(i == 0)
  64.       {
  65.          tx = _root.Test._x;
  66.          ty = _root.Test._y;
  67.       }
  68.       else
  69.       {
  70.          tx = this["line" + (i - 1)]._x;
  71.          ty = this["line" + (i - 1)]._y;
  72.       }
  73.       xdiff = (tx - me._x) / speed;
  74.       ydiff = (ty - me._y) / speed;
  75.       if(Math.abs(xdiff) > 1)
  76.       {
  77.          me._x += xdiff;
  78.       }
  79.       if(Math.abs(ydiff) > 1)
  80.       {
  81.          me._y += ydiff;
  82.       }
  83.       me._x += wind;
  84.       me._y += gravity;
  85.       draw.lineStyle(length - i,16777215,100);
  86.       draw.moveTo(me._x,me._y);
  87.       draw.lineTo(tx,ty);
  88.       me.swapDepths(1);
  89.       _root.Test.swapDepths(999);
  90.       i++;
  91.    }
  92. };
  93. var keyListener = new Object();
  94. keyListener.onKeyDown = function()
  95. {
  96.    if(_root.ammo > 499)
  97.    {
  98.       _root.ammo -= 30;
  99.       bomb = attachMovie("bomb","bomb",_root.getNextHighestDepth());
  100.       bomb._y = Test._y;
  101.       bomb._x = Test._x;
  102.       bomb._rotation = Test._rotation;
  103.    }
  104. };
  105. Key.addListener(keyListener);
  106.